import axios from 'axios'

export function getHelpList(page = 1, limit = 10, courseId) {
    let url = `http://localhost:10010/eduservice/edu-comment/getCommentPage/${page}/${limit}`;
    if (courseId) {
        url += `?courseId=${courseId}`;
    }
    return axios.get(url);
}

export function addHelp(data, token) {
    return axios.post(
        'http://localhost:10010/eduservice/edu-comment/auth/addComment',
        data,
        { headers: { Authorization: `Bearer ${token}` } }
    )
}

// 根据id获取详情
export function getHelpDetail(id) {
    return axios.get(`http://localhost:10010/eduservice/edu-comment/getById/${id}`)
} 